《Cursor文檔》-Review and triage templates
Each template is one model turn. A review template reads the diff and posts one comment, and the triage template comments on a ticket you already filed.
閱讀全文《Cursor文檔》-Review pull requests with owners policies
This agent risk tiers every pull request in your repository, requests the owners as reviewers, and approves what your policy allows. Rules live in .agentic owners/policy.yml files at any depth. The closest policy to a changed file wins. The agent reads policies from the PR's base ref, so a PR can't exempt itself.
閱讀全文《Cursor文檔》-Tools
A tool is a typed action the model can call, such as hitting an API, running a query, or writing a file. Each file in bot/tools/ defines one tool, and the filename is the name the model sees. Server tools run on the serving host, and agent tools run as scripts next to the agent.
閱讀全文《Cursor文檔》-Subagents
A subagent is a specialist child agent the model can delegate to mid turn. Each one lives under bot/subagents/<id / with a required agent.ts.
閱讀全文《Cursor文檔》-Skills
A skill is an on demand procedure in the SKILL.md convention. Agent SDK advertises each skill by its description, and the model loads a skill only when the task calls for it. Skills give an agent a multi step workflow without carrying it in the always on instructions.
閱讀全文《Cursor文檔》-Sessions, events, and streaming
A session keeps one conversation, its workspace, and an append only record of every message and tool call.
閱讀全文《Cursor文檔》-Schedules and reminders
A schedule or a reminder lets an agent act without an inbound message.
閱讀全文《Cursor文檔》-Project layout
An Agent SDK project keeps agent files under bot/, and each file's path determines how Agent SDK loads it. Evals live in evals/ at the project root, beside bot/.
閱讀全文《Cursor文檔》-Playground
agent sdk serve hosts a web playground at http://127.0.0.1:3000/playground. When one server hosts multiple agents, each agent's playground is at /<slug /playground and / lists them.
閱讀全文《Cursor文檔》-Memory
A memory hook appends one record per turn to a journal. The model reads the journal with its file tools when its instructions send it there.
閱讀全文《Cursor文檔》-Instructions
Instructions are the always on prompt for every turn. A root agent requires them, and a subagent may inline instructions in agent.ts instead.
閱讀全文《Cursor文檔》-HTTP API
In the default multi agent layout each agent serves its routes at /<slug /v1/ , and mode single serves them at /v1/ .
閱讀全文《Cursor文檔》-Hooks
A hook subscribes to selected session events and can run a side effect after each matching event is recorded. Hooks run in the serving process for every session of the agent. They cannot change the turn, the prompt, or the reply. A handler that throws is logged and skipped.
閱讀全文《Cursor文檔》-Extensions
An extension packages capabilities that would otherwise live under bot/, such as tools, skills, and connections. One mount file adds them under a namespace without copying their source into your project.
閱讀全文《Cursor文檔》-Evals
Evals run fixed cases against an agent and record whether its turns, tools, events, and output meet a contract. The Evals guide covers the regression workflow.
閱讀全文《Cursor文檔》-MCP connections
An MCP connection gives the agent tools from an MCP server. Each file under bot/mcp connections/ default exports defineConnection from @grok/agent sdk/connections, and its filename becomes the server name. A connection reaches a remote HTTP server, a local stdio process, the signed in Cursor account's connectors, or a peer agent by slug.
閱讀全文《Cursor文檔》-Agent SDK CLI
The CLI needs Node 22.13 or newer. Run agent sdk <command help to see every flag for that command.
閱讀全文《Cursor文檔》-Channels
A channel connects an external surface to agent sessions. A file at bot/channels/<id .ts defines channel <id and mounts its routes under /v1/channels/<id , and the built in HTTP channel serves the HTTP API routes and is always available.
閱讀全文《Cursor文檔》-Artifacts
Artifacts are durable outputs such as reviewed pull requests or reports. Records persist across sessions, update by key, and can be listed, streamed, or downloaded.
閱讀全文《Cursor文檔》-Agent config
bot/agent.ts default exports defineAgent(config), which sets the model that runs the agent and the defaults for a local run. Every field is optional on the root agent.
閱讀全文《Cursor文檔》-Access
Deployed Agents calls the three access levels Viewer, Editor, and Owner, and the API calls them viewer, deployer, and admin. admin is Owner, and a write also accepts owner for that role and editor for Editor.
閱讀全文《Cursor文檔》-Build a PR reviewer with Agent SDK
You'll build a reviewer that rates each pull request as trivial, moderate, or large, then approves safe changes or asks for a human review.
閱讀全文《Cursor文檔》-Hillclimbing
Hillclimbing improves an agent one measured change at a time. Hold the inputs fixed, change one thing, and keep it only when the same run gets better without moving the behavior you froze.
閱讀全文《Cursor文檔》-Authenticate deployed agents with OIDC
A deployed Agent SDK agent can mint short lived OIDC JWTs signed by Cursor and exchange them for temporary cloud credentials or service tokens without storing static access keys in deployment secrets.
閱讀全文《Cursor文檔》-Webhook agents
A custom channel turns an event from another system into an agent conversation and sends the result back to the system that started it. Use one when the built in HTTP API doesn't match the provider's payload, conversation key, or reply path.
閱讀全文《Cursor文檔》-Microsoft Teams agents
A Teams agent wakes when someone @mentions it in a channel or group chat, messages it in a personal chat, or posts in a channel it watches. It answers in the same reply chain. teamsChannel() takes the same engagement options as slackChannel(), so an agent that already runs in Slack can run in Teams with the same shape of config.
閱讀全文《Cursor文檔》-Run MCP connectors as the signed-in user
On Cursor hosting, a cursorAccount: true MCP connection defaults to credentials: "shared". Every turn calls the MCP server through the deployment's service account.
閱讀全文《Cursor文檔》-PagerDuty agents
A PagerDuty agent wakes when an incident triggers, investigates it, and writes what it found back to the incident. pagerdutyChannel() verifies PagerDuty's v3 webhooks and sends every later event for that incident to the session that started the investigation.
閱讀全文《Cursor文檔》-OpenTelemetry
Agent SDK sends traces, metrics, and logs to an OTLP collector when you set the OTEL variables. Record your own with @opentelemetry/api.
閱讀全文《Cursor文檔》-Migrate an early-alpha project to architecture v2
Use this guide only for an Agent SDK project deployed on architecture v1 during the early alpha. Every other project already runs on v2.
閱讀全文《Cursor文檔》-Connect a private MCP server with OAuth
Host MCP OAuth lets the machine running your agent authorize a remote MCP server without putting tokens in your source or workspace.
閱讀全文《Cursor文檔》-Use Jev in review tools
\[!WARNING] Experimental. @grok/agent sdk/extensions/jev is experimental. Its exports and behavior can change in any release, without a deprecation period.
閱讀全文《Cursor文檔》-Self-improvement
The improve extension lets an agent turn "change how you work" into a change to its own source. The agent writes a brief, a Cursor cloud agent edits a checkout and opens a pull request, and the agent reports the pull request.
閱讀全文《Cursor文檔》-GitLab agents
A GitLab agent wakes on merge request, note, and pipeline events from GitLab.com or a self managed server, then writes its results back to the project. Declare onMergeRequest, onNote, or onPipeline on gitlabChannel() for each event that should wake it.
閱讀全文《Cursor文檔》-GitHub agents
A GitHub agent wakes from repo events, reads the latest PR and CI state, then writes back reviews, comments, checks, or pushes. Every wake for the same pull request resumes one session, so the open, later comments, and CI results share one conversation.
閱讀全文《Cursor文檔》-Convert a Cursor Automation
Convert a dashboard Automation when you want to edit its behavior as code, test it locally, or deploy it as an Agent SDK project. To change only the prompt or the trigger, stay in the dashboard.
閱讀全文《Cursor文檔》-Cloud agents
The cursor cloud agents extension lets an Agent SDK agent hand coding work to Cursor cloud agents. A cloud agent works in a repository checkout and pushes branches and pull requests while your agent keeps talking to the person.
閱讀全文《Cursor文檔》-Bitbucket agents
A Bitbucket agent wakes on pull request, comment, and push events from Bitbucket Cloud or Data Center, then writes its results back to the repository. Declare onPullRequest, onPullRequestComment, or onPush on bitbucketChannel() for each event that should wake it.
閱讀全文《Cursor文檔》-Peer agents
A peer connection lets one agent ask an independent specialist for help. The specialist keeps its own instructions, tools, and sessions. On Cursor hosting, team owned agents reach each other by deployment slug, and Agent SDK handles routing and authentication for you.
閱讀全文《Cursor文檔》-Evals
An eval sends a fixed input to the real agent and checks which tools ran and what the answer looks like. To improve an agent and lock each win with an eval, follow Hillclimbing.
閱讀全文《Cursor文檔》-Deploy an Agent SDK project
Deploy a pushed Git ref as a stable service on Cursor managed hosting, or self host it when you need your own network or process controls.
閱讀全文《Cursor文檔》-Build with a coding agent
A coding agent in your checkout can create an Agent SDK project, call its tools, run a real turn, and check the result from the CLI. You approve the plan and any side effects.
閱讀全文《Cursor文檔》-Agent SDK
Agent SDK lets you define, test, evaluate, and deploy agents as code. It uses the Cursor SDK harness that powers Bugbot, Security Review, Approval Bot, and Rollouts.
閱讀全文dsh-claude-code-sdk:把 DSH 任務委派給本機 Claude Code
通過官方 Claude Agent SDK,把自包含的編碼任務委派給本機 Claude Code 執行,結果回傳給 DSH。DSH 當 leader,Claude Code 當 worker。插件把當前 DSH 對話歷史注入到任務上下文,worker 實際調用過的工具不會進入外層 DSH 會話的上下文。
閱讀全文dsh-claude-bridge:通過 Agent SDK 驅動 Claude Code CLI
`dsh-claude-bridge` 是 DeepSeek Harness 的插件,旨在通過運行 Claude Code CLI,將 Claude Pro 或 Max 訂閱額度計入 DSH 計費,避免使用 OAuth 流程。它支持流式輸出、工具調用及 1M token 上下文窗口等核心功能。安裝需指定 `--profile web`,配置文件需指定路徑。插件通過讀取 Claude Code CLI 憑證文件運行,並接管部分環境變量以防止計費錯誤。該插件由 shaneconner 維護,基於 MIT 許可證開源。
閱讀全文